<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
	</body>

</html>
<script>
	//构造函数
	function Structure(name, age, sex, user, skill) { 
		this.name = name;
		this.age = age;
		this.sex = sex
		this.user = user;
		this.skill = skill;
		this.showName = function() {
			alert(this.name + "," + this.age + "," + this.sex + "," + this.user + "," + this.skill)
		}
	}
	var structures = new Structure('小明', '18', '男', '有男朋友', '男朋友会说话')
	structures.showName()

	//工厂模式
	function Blog(name,card,price,explain) {
		this.name = name;
		this. card= card;
		this. price= price;
		this. explain= explain;
		this.fun = function() {
			alert(this.name+','+this.card+','+this.price+','+this.explain);
		}
	}
    
	var blog = new Blog('兰博基尼', '合格','10元','塑料产品','不宜食用');
	blog.fun()
</script>